<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
  <head>
    
    <%@ include file="/WEB-INF/include/meta.jsp"%>
    <%@ include file="/WEB-INF/include/css.jsp"%>
    <title>人马君</title>
  </head>
  <!-- end header -->
  <body>
    <div class="page-group">
      <div class="page page-current bg-light-gray" id="pt-main" style="background:#333;">
        <nav class="bar bar-tab punch-card-bar">
          <a class="tab-item external active" href="${ctx.host}/courses/${batchCourseware.monthly.id}/batches/${batchCourseware.id}/units">
            <span class="icon icon-today"></span>
            <span class="tab-label">今日</span>
          </a>
          <a class="tab-item external" href="${ctx.host}/courses">
            <span class="icon icon-lesson"></span>
            <span class="tab-label">课程</span>
          </a>
          <a class="tab-item external" href="${ctx.host}/profile">
            <span class="icon icon-profile"></span>
            <span class="tab-label">我的</span>
          </a>
        </nav>

        <div class="content">
          <div class="result-wrap">
            <div class="result-body">
              <div class="user-avatar text-center">
                <img src="${user.profile.avatar}"/>
                <span class="user-name">${user.name}</span>
              </div>
              <p class="student-rank text-center">你是今天<br/>第<span style="font-size: 1.8rem; font-weight: bold;">${dailyCourseware.signinOrder}</span>名<br/>完成运动打卡的学员</p>
              <div class="clock-day">
                <p class="no-margin">你已坚持打卡</p>
                <div class="time"><span>${courseRound.signinDays}</span>DAYS</div>
              </div>
            </div>
          </div>
          <a href="javascript:void(0);" style="border-radius: .2rem; width: 9.75rem; height: 1.75rem; margin: 0 auto 1rem;" class="button button-fill ft-market-btn ft-button-yellow share-btn">分享</a>
        </div>
      </div>
    </div>
    
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource root="${ctx.resource}/build" type="script" src="js/page/course/unit/unit-result.js" />
    <script type="text/javascript">
      require(['page/course/unit/unit-result'], function(page) {
        page.init({
          "monthlyId": "${batchCourseware.monthly.id}",
          "batchId": "${batchCourseware.id}",
          "unitId": "${unitId}",
          'signinDays': '${courseRound.signinDays}',
          'signinMinutes': '${dailyCourseware.minutes}',
          'jsConfig': JSON.parse('${wechatJsConfig}'),
          'inviter': '${user.openid}'
        })
      })
    </script>
    
  </body>
</html>